<%= render :partial => "shared/admin_links" %>
<%= will_paginate_locale @products %>
<%= link_to "#{t("site.cms.action.new")} #{t("site.cms.entity.product")}", new_product_path, :class=> "addProducts" %>
<div class="homeButton"><%= link_to (image_tag("/images/buttons/homeButton.jpg", :alt => "24_menu", :class => "homeImage")),  root_path, :class => "homeLink" %></div>
<table class="adminTableProducts" border="0" width="100%" cellpadding="4" cellspacing="0">
  <tr class="adminTableHeader"><th><%= t("site.cms.label.id") %></th><th><%= t("site.cms.label.product") %></th><th><%= t("site.cms.label.categor") %></th>
    <th><%= t("site.cms.label.shop") %></th><th><%= t("site.cms.label.town") %></th><th><%= t("site.cms.action.edit") %></th><th><%= t("site.cms.action.delete") %></th></tr>
  <% @products.each do |product| %>
  <tr>
    <td><%= product.id %></td>
    <td><%= product.name %></td>
    <% categor = product.categor %>
    <% shop = categor ? categor.shop : nil %>
    <% town = shop ? shop.town : nil %>
    <td><%= categor.name if categor %></td>
    <td><%= shop.name if shop %></td>
    <td><%= town.name if town %></td>
    <td><%= link_to "#{t("site.cms.action.edit")} #{t("site.cms.entity.product")} #{product.id}", edit_product_path(:id => product.id) %></td>
    <td><%= link_to "#{t("site.cms.action.delete")} #{t("site.cms.entity.product")} #{product.id}", product_path(:id => product.id),
  :method => :delete, :confirm => t("site.cms.label.sure") %></td>
  </tr>
  <% end %>
</table>
<%= will_paginate_locale @products %>
